#include "ADUGameManager.h"
#include "ADUConstants.h"
#include "../MainMenu/ADUStartScene.h"
#include "../HelloWorldScene.h"

USING_NS_CC;

ADUGameManager *ADUGameManager::instance = NULL;

int ADUGameManager::scores = 0;

ADUGameManager *ADUGameManager::getInstance() {
	if (!instance) {
		instance = new ADUGameManager;
	}
	return instance;
}

void ADUGameManager::increaseScores(int value) {
	scores += value;
}
void ADUGameManager::increaseScores() {
	increaseScores(1);
}

void ADUGameManager::RunScene(int scene) {
	CCScene *pScene = NULL;

	if (scene == SCENE_START) {
		pScene = ADUStartLayer::scene();
	} else if (scene == SCENE_GAME) {
		pScene = HelloWorld::scene();
	} /*else if (scene == SCENE_GAMEOVER) {
		// Do something here
		pScene = CGameOverLayer::scene();
	} else if (scene == SCENE_INTRO) {
		// Do something here
		pScene = ADUIntroductionLayer::scene();
	}
*/
	if (CCDirector::sharedDirector()->getRunningScene() == NULL) {
		CCDirector::sharedDirector()->runWithScene(pScene);
	} else {
//		CCScene* newScene = CCTransitionCrossFade::create(0.5, pScene);
//		if(newScene)
//		{
//			CCDirector::sharedDirector()->replaceScene(newScene);
//		}
		CCDirector::sharedDirector()->replaceScene(pScene);
	}
}
